'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
    // const { router, controller } = app;
    // router.get('/', controller.home.index);

    // 错误处理
    app.get(/^\/40*/, 'error._40x');
    app.get(/^\/50*/, 'error._50x');
    app.get('/error', 'error.error');
    app.get('/upload', 'upload.get');

    // 首页
    app.get('/', 'home.index');
    app.get('/index',  'home.index');
    //更多咨询
    app.get('/newslist','home.newslist');
    //资讯详情
    app.get('/information', 'home.eduDetail');
    //评论详情
    app.get('/replaylist','comment.replaylist');
    //发布评论
    app.post('/information','home.eduDetail');
    //资讯回评
    app.post('/onereviewsend','comment.onereviewsend');



    /*
    社区模块
     */
    //社区首页
    app.get('/bbs',  'bbs.bbs');
    //查看更多分类
    app.get('/bbsmore','bbs.bbsmore');
    //根据分类编号查看社区详情
    app.get('/bbscont','bbs.bbscont');
    //社区帖子详情
    app.get('/postdetail','bbs.postdetail');
    //社区帖子发布评论
    app.post('/postdetail','bbs.postdetail');
    //社区回评
    app.post('/towreviewsend','comment.towreviewsend');
    //社区评论详情
    app.get('/postreplaylist','comment.postreplaylist');
    //我的收藏
    app.get('/attention','bbs.attention');
    //问答详情
    app.get('/askquestions','bbs.askquestions');
    //查看更多问答
    app.get('/askquestionslist','bbs.askquestionslist')
    //社区详情用户信息
    app.get('/userinfo','user.userinfo');
    //社区发帖页面
    app.get('/posting','bbs.posting');
    //社区发帖
    app.post('/posting','bbs.posting');
    //社区问答页面
    app.get('/asking','bbs.asking');
    //社区发布问答
    app.post('/asking','bbs.asking');
    //社区搜索的页面
    app.get('/search','bbs.search');








    /*
    教务模块
     */

    //教务主页
    app.get('/teaching','teaching.teaching');
    //公告详情
    app.get('/ann','teaching.ann');
    //课件列表
    app.get('/prepare','teaching.prepare');
    //课件内容
    app.get('/preparedetail','teaching.preparedetail');
    //学习分析
    app.get('/teachinganalysis','teaching.analysis')



    /*
    作业管理模块
     */
    //作业管理主页
    app.get('/homework','homework.homework');
    //作业报告
    app.get('/homeworkdetail','homework.homeworkdetail');
    //作业详情
    app.get('/homeworkdetails','homework.homeworkdetails');
    //完成情况
    app.get('/complete','homework.complete');
    //完成详情
    app.get('/completedetail','homework.completedetail');



    /*
    题库管理
     */

    //题库主页
    app.get('/tasks','teachingtask.tasks');
    //删除题库
    app.post('/tasks','teachingtask.tasks');



    //增加题目
    app.get('/addtask','teachingtask.addtask');
    //增加完成页面
    app.get('/tasksucceed','teachingtask.tasksucceed');



    /*
    布置作业模块
     */
    //布置作业方式
    app.get('/arrhomework','homework.arrhomework');
    //选择教材版本
    app.get('/version','homework.version');
    //统一出题-选择班级
    app.get('/arrhomework1','homework.arrhomework1');
    //一对一出题-选择班级
    app.get('/otohomework1','homework.otohomework1');
    //一对一出题-选择学生
    app.get('/otohomework2','homework.otohomework2');
    //选择知识点
    app.get('/arrhomework2','homework.arrhomework2');
    //选择题目
    app.get('/arrhomework3','homework.arrhomework3');
    //题目解析
    app.get('/arrhomework4','homework.arrhomework4');
    //已选题目
    app.get('/selected','homework.selected');
    //发布作业
    app.get('/release','homework.release');
    app.post('/release','homework.release');

    /*
    请假模块
     */

    //请假页面
    app.get('/leave','teaching.leave.leave');
    app.post('/leave','teaching.leave.leave');

    //最新假条
    app.get('/leaveinfo','teaching.leave.leaveinfo');

    //假条详情
    app.get('/leavedetail','teaching.leave.leavedetail');
    //请假记录
    app.get('/leavelist','teaching.leave.leavelist');
    //请假条撤销
    app.post('/delleave','teaching.leave.delleave');
    //请假条修改
    app.post('/editleave','teaching.leave.editleave');



    /*
    预警模块
     */

    //预警主页
    app.get('/warning','teaching.warning.warning');
    //我的模块预警设置
    app.get('/warningsetting','my.warning.warningsetting');

    /*
    通知消息模块
     */

    //通知首页
    app.get('/news','news.news');




    /*
    我的模块
     */

    //我的首页
    app.get('/my','my.my.my');
    //教师信息
    app.get('/teacherinfo','my.teacherinfo.teacherinfoedit');
    //教师手机号修改页面
    app.get('/editphone','my.teacherinfo.editphone');
    //教师收藏
    app.get('/collect','bbs.attention');
    //我的设置
    app.get('/setting','my.my.setting');
    //更换手机号
    app.get('/changephone','my.my.changephone');
    //更换密码
    app.get('/changepwd','my.my.changepwd');
    //发送验证码接口
    app.get('/getyzm','my.my.getyzm');
    //修改密码接口
    app.post('/editpassword','my.my.editpassword');
    //我的班级
    app.get('/classlist','my.class.classlist');
    //我的学生
    app.get('/studentlist','my.class.studentlist');
    //我的学生详情
    app.get('/studentinfo','my.class.student');
    //副监护人详情
    app.get('/guardian','my.class.guardian');


    /*
    分页模块
     */

    //社区评论分页刷新
    app.get('/postcommentlist','commentlist.postcommentlist');
    //咨询评论分页刷新
    app.get('/commentlist','commentlist.commentlist');
    //题库分页刷新
    app.get('/taskpaging','paging.taskpaging');


    /*
    收藏模块
     */

    //已收藏
    app.post('/setcollect','collect.setcollect');
    //取消收藏
    app.post('/delcollect','collect.delcollect');


    //点赞模块

    //点赞
    app.post('/clicklike','like.clicklike');
    //取消点赞
    app.post('/noclicklike','like.noclicklike');





    // 登陆
    app.get('/login', 'login.login');          
    app.post('/login', 'login.login');
    //退出登录
    app.post('/logout','login.logout');




    /*
    IM
     */
    app.get('/get/imToken', 'im.getToken');
    app.get('/imDetail', 'im.imDetail');

};
